package com.joesem.sale.client.logic.workOrder

import android.os.Bundle
import android.util.Log
import com.jiaxing.sale.client.databinding.ActivityBomBinding
import com.jiaxing.sale.client.databinding.LayoutToolbarBinding
import com.joesem.sale.client.base.BaseActivity
import com.joesem.sale.client.base.createViewModel
import com.joesem.sale.client.base.visible
import com.joesem.sale.client.logic.workOrder.viewModel.BomViewModel


class BomActivity : BaseActivity<ActivityBomBinding>() {

    private val viewModel by createViewModel<BomViewModel>()

    override fun LayoutToolbarBinding.toolbar(savedInstanceState: Bundle?) {
        visible()
        toolbarTheme()
        toolbarTitle.text = "个人备件库"
    }

    override fun ActivityBomBinding.initListener() {
        srlRefresh.apply {
            setOnRefreshListener {
                viewModel.getBomList(true)
            }
            setOnLoadMoreListener {
                viewModel.getBomList(false)
            }
        }
    }

    override fun ActivityBomBinding.initView(savedInstanceState: Bundle?) {
        srlRefresh.autoRefresh()
    }
}